
from flask import Flask,render_template
 
app = Flask(__name__)
app.debug = True
 
@app.route('/')
def hello():
	with open('list.txt','r') as fl:
		lis=fl.readlines()
	return render_template('index.html',lis=lis)

@app.route('/view/<pagename>')
def view(pagename):
	i=0
	page=pagename+'.txt'
	with open(page,'r',encoding='utf8') as fl:
		string=fl.readlines()
	return render_template('view.html',title=page,text=string)

if __name__=="__main__":
	app.run(host='0.0.0.0',port=80,debug=True)